package cn.dengta.webapp.im.form.query;

import java.util.List;

import cn.dengta.context.model.WesKit;
import cn.dengta.webapp.base.form.BaseForm;
import cn.dengta.webapp.im.entity.GreetRecommendStatistics;
import cn.dengta.webapp.user.entity.User;
import cn.dengta.webapp.user.model.Gender;
import lombok.*;
import me.codeplayer.util.X;

@Setter
@Getter
public class GreetRecommendStatisticsQuery extends BaseForm<GreetRecommendStatistics> {

	/** 用户ID */
	public Long userId;
	/** 性别 */
	public Gender userGender;
	/** 性别 */
	public String userNickname;
	/** 过滤用户 */
	public Long[] filterUserIds;
	/** 0=非钻石用户，1=钻石用户 */
	public Integer coinTab;
	/** 分页数 */
	public Long size;
	/** 分页偏移 */
	public Long offset;
	@Setter(AccessLevel.NONE)
	private User user;
	/** 可见分包数据 */
	public List<Integer> canWesKits;

	public void setUserGender(Gender userGender) {
		this.userGender = userGender;
		user().setGender(userGender);
	}

	public void setUserId(Long userId) {
		this.userId = userId;
		user().setId(userId);
	}

	public void setUserNickname(String userNickname) {
		this.userNickname = userNickname;
		user().setNickname(userNickname);
	}

	public User user() {
		return user = X.getElse(user, User::new);
	}

}
